<template>
  <div>
    <el-row :gutter="5" type="flex" style="flex-wrap:wrap">
      <el-form ref="elForm" :model="dataForm" size="small" label-width="120px" label-position="right" :rules="rules" v-loading="loading">
        <el-col :span="24">
          <el-form-item label-width="0">
            <groupTitle content-identity="left" content="基本信息"></groupTitle>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('brand')">
          <el-form-item label="收款品牌" prop="brand">
            <el-select v-model="dataForm.brand" placeholder="请选择收款品牌" clearable required :style="{ width: '100%' }" :disabled="judgeWrite('brand')">
              <el-option v-for="(item, index) in brandOptions" :key="index" :label="item.fullName" :value="item.enCode"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('customerName')">
          <el-form-item label="客户名称" prop="customerName">
            <el-input v-model="dataForm.customerName" :style="{ width: '100%' }" :disabled="judgeWrite('customerName')"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('school')">
          <el-form-item label="意向学校" prop="school">
            <el-input v-model="dataForm.school" placeholder="请输入意向小学/中学" clearable :style="{ width: '100%' }" :disabled="judgeWrite('school')"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('area')">
          <el-form-item label="所在区域" prop="area">
            <custom-address v-model="dataForm.area" clearable required :styleWidth="{ width: '100%' }" :disabled="judgeWrite('area')"></custom-address>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('managerId')">
          <el-form-item label="招商经理" prop="managerId">
            <el-select v-model="dataForm.managerId" placeholder="请选择招商经理" clearable required :style="{ width: '100%' }" :disabled="judgeWrite('managerId')">
              <el-option :key="item.id" :label="item.realName" :value="item.id" v-for="item in managerIdOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('contractPolicy')">
          <el-form-item label="加盟政策" prop="contractPolicy">
            <el-input v-model="dataForm.contractPolicy" placeholder="请输入加盟政策" clearable required :style="{ width: '100%' }" :disabled="judgeWrite('contractPolicy')"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="0">
            <groupTitle content-identity="left" content="缴费信息"></groupTitle>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('paymentDate')">
          <el-form-item label="收款日期" prop="orderPayment.paymentDate">
            <el-date-picker v-model="dataForm.orderPayment.paymentDate" placeholder="请选择收款日期" clearable required :style="{ width: '100%' }" type="datetime" format="yyyy-MM-dd" value-format="timestamp" :disabled="judgeWrite('paymentDate')"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('paymentMethod')">
          <el-form-item label="收款方式" prop="orderPayment.paymentMethod">
            <el-select v-model="dataForm.orderPayment.paymentMethod" placeholder="请选择收款方式" clearable required :style="{ width: '100%' }" :disabled="judgeWrite('paymentMethod')">
              <el-option v-for="(item, index) in methodOptions" :key="index" :label="item.fullName" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('amount')">
          <el-form-item label="加盟金额" prop="orderPayment.amount">
            <el-input v-model="dataForm.orderPayment.amount" placeholder="请输入实收金额" clearable required :style="{ width: '100%' }" :disabled="judgeWrite('amount')"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-if="judgeShow('bond')">
          <el-form-item prop="orderPayment.bond">
            <template v-slot:label>
              <span>
                <span v-if="dataForm.orderPayment.isBond" style="color: #F56C6C;margin-right: 4px">*</span>
                {{ '保证金金额' }}
              </span>
            </template>
            <el-input v-model="dataForm.orderPayment.bond" placeholder="请输入保证金金额" :disabled="!dataForm.orderPayment.isBond || judgeWrite('bond')" clearable :style="{ width: '100%' }">
              <el-checkbox slot="prepend" v-model="dataForm.orderPayment.isBond"></el-checkbox>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="judgeShow('isCompletepay')">
          <el-form-item label="是否完款" prop="orderPayment.isCompletepay">
            <el-radio-group v-model="dataForm.orderPayment.isCompletepay" size="small" :disabled="judgeWrite('isCompletepay')">
              <el-radio :label="true">是</el-radio>
              <el-radio :label="false">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>

        <!-- <el-col :span="12">
          <el-form-item label="余款金额" prop="orderPayment.balance">
            <template v-slot:label>
              <span>
                <span v-if="dataForm.orderPayment.isBalance" style="color: #F56C6C;margin-right: 4px">*</span>
                {{ '余款金额' }}
              </span>
            </template>
            <el-input v-model="dataForm.orderPayment.balance" placeholder="请输入余款金额" clearable :disabled="!dataForm.orderPayment.isBalance" :style="{ width: '100%' }">
              <el-checkbox slot="prepend" v-model="dataForm.orderPayment.isBalance"></el-checkbox>
            </el-input>
          </el-form-item>
        </el-col> -->
        <!-- <el-col :span="12" v-if="type || dataForm.id == ''">
          <el-form-item label="收款类型" prop="orderPayment.paymentType">
            <el-radio-group v-model="dataForm.orderPayment.paymentType" size="small">
              <el-radio :label="'1'">全款</el-radio>
              <el-radio :label="'2'">定金</el-radio>
            </el-radio-group> -->
        <!-- <el-radio-group v-else-if="!type" v-model="dataForm.orderPayment.paymentType" size="small">
              <el-radio :label="'3'">保证金</el-radio>
              <el-radio :label="'4'">余款</el-radio>
            </el-radio-group> -->
        <!-- </el-form-item>
        </el-col> -->

        <el-col :span="24" v-if="judgeShow('screenshot')">
          <el-form-item label="付款凭证" prop="orderPayment.screenshot">
            <custom-upload-img v-model="dataForm.orderPayment.screenshot" :fileSize="5" sizeUnit="MB" :limit="9" :disabled="judgeWrite('screenshot')"></custom-upload-img>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export { default } from './index.js'
</script>
<style scoped>
.el-time-spinner__wrapper {
  width: 100% !important;
}
@import url(index.scss);
</style>
